package com.bosicloud.cmb.ibp.aws.adapter.api;

import com.amazonaws.services.cloudformation.model.Output;
import com.bosicloud.cmb.ibp.aws.adapter.commom.constant.UrlDefine;
import com.bosicloud.cmb.ibp.aws.adapter.commom.dto.CreateAwsEnvDTO;
import com.bosicloud.cmb.ibp.aws.adapter.commom.dto.CreateCFStackResponseDTO;
import com.bosicloud.cmb.ibp.aws.adapter.commom.dto.RequestDescribeStackDTO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author Jack Peng / ziliang.peng@bosicloud.com
 */
@FeignClient(value = "CloudFormationService", url = "${ibp.service.aws-adapter-url}")
public interface CloudFormationClient {

    @PostMapping(value = UrlDefine.CF_CREATE_TOKEN)
    String getCreateCFStackToken();

    @PostMapping(value = UrlDefine.CF_CREATE)
    CreateCFStackResponseDTO createCFStack(@RequestBody CreateAwsEnvDTO awsenv);

    @PostMapping(value = UrlDefine.CF_DESCRIBE_STACK)
    List<Output> descirbeStack(@RequestBody RequestDescribeStackDTO requestDescribeStackDTO);

}
